package com.example.administrator.maizuofilm.cinemaschedule;

import com.example.administrator.maizuofilm.moviedetails.bean.Details;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

/**
 * Created by a on 2016/7/14.
 */
public class CinemaSchedulingPresenter implements CinemaSchedulingContract.CSPresenter {
    private CinemaSchedulingContract.CSModel mModel;
    private CinemaSchedulingContract.CSView mView;
    public CinemaSchedulingPresenter(CinemaSchedulingContract.CSModel model,CinemaSchedulingContract.CSView view){
        this.mModel=model;
        this.mView=view;
        EventBus.getDefault().register(this);

    }

    @Override
    public void init(String path) {
        mModel.init(path);
    }
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void Sub(Details details){
        if (details==null){
            mView.onInitFail("发送错误");
        }else {
            mView.onInitSuccess(details);
        }
    }


}
